package com.wyg.factory;

/**
 * @description:
 * @author: WYG
 * @time: 2020/12/29 18:13
 */

public class ConcreteCreator extends Creator{
    @Override
    public <T extends Product> T createProduct(Class<T> c) {
        Product product = null;
        try {
            product = (Product) Class.forName(c.getName()).getDeclaredConstructor().newInstance();
        } catch (Exception e) {

        }
        return (T)product;
    }
}
